<template>
  <el-container class="home">
    <el-header>
      <Header></Header>
    </el-header>
    <el-container class="mainBox">
      <Asider @func="getCollapseValue"></Asider>
      <el-main class="main" :class="{'isOpen':isCollapse}">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Header from '../../components/Header'
import Asider from '../../components/Asider'
export default {
  data () {
    return {
      isCollapse: false
    }
  },
  created () {

  },

  methods: {
    // 获取侧边栏子组件内值
    getCollapseValue (val) {
      this.isCollapse = val
    }
  },

  components: {
    Header,
    Asider
  }

}
</script>

<style scoped lang='less'>
.home {
  width: 1200px;
  margin: 0 auto;
  /deep/ .el-header {
    padding: 0px;
    margin-bottom: 10px;
  }
  /deep/ .el-header {
    padding: 0px;
    margin-bottom: 10px;
  }
  /deep/ .el-main {
    padding: 0 10px 5px 0;
  }
  .mainBox {
    display: flex;
    position: relative;
    .main {
      width: 100%;
      margin-left: 210px;
      overflow: hidden;
    }
    .isOpen {
      margin-left: 70px;
    }
  }
}
</style>
